package compiler.absyn;

/**
 * If Type is INT type=0
 * else if Type is VARCHAR type=1
 * else if Type is DATE type=2
 * else if Type is TIME type=3 
 * @author baoyoucchen
 *
 */
public class TypeDef extends Absyn{
	public int type;
	public int length;
	
	public TypeDef(int p,int t,int l){
		pos = p;
		type = t;
		length = l;
	}
	public String toString(){
		if(type==0)
			return "INT";
		else if(type==1)
			return "VARCHAR("+length+")";
		else if(type==2)
			return "DATE";
		else if(type==3)
			return "TIME";
		else 
			return null;
	}
}	
